home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
TO_PRN.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
3KB
|
79 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_To_Prn( cPrinterCodesFile, lRetryable ) --> lPrinterStatus
PARAMETERS:
cPrinterCodesFile : text file containing printer commands or codes.
lRetryable : TRUE or not specified (NIL), user can retry.
FALSE, user cannot retry.
SHORT:
Set printer on (with optional command codes from file).
DESCRIPTION:
_To_Prn() simply set's output to printer, eliminating the need for three
print redirection statements each time.
Optionally, you may specify a set of printer initialization codes by
placing them in a text file and specifying that file in cPrinterCodesFile.
Each line of the file is sent to the printer "as-is" before
_To_Prn() returns. If not specified, or if invalid file, this option
is ignored.
If the printer is not on-line (ie, !isprinter()) when the call to _To_Prn()
is made, and lRetryable is specified and is FALSE, then the function
does nothing to the settings of the _SET_PRINT, _SET_DEVICE, and
_SET_CONSOLE, and immediately returns the status of the printer (FALSE).
THE PRINT SETTINGS WILL NOT HAVE BEEN AFFECTED!
If, however, the lRetryable is TRUE or NIL, then a dialogue box is
invoked informing the user that the printer is offline and to turn it on.
The user is given three attempts at setting the printer on-line before
the application is terminated with the message:
Printer Error During _To_Prn()
This is NOT a run-time error, but an intentional shutdown of the application.
Consequently, no debug/run-time error data is collected in the errorlog
file. See _Terminate() for more information.
If the printer is properly set on-line within the three allowed attempts,
then the _To_Prn() function carries on as if nothing had happened, and
the settings of PRINT, DEVICE and CONSOLE are set to TRUE, "PRINT",
FALSE respectively.
NOTE:
See also, HPRINTF(), _Terminate(), _LPrint()
EXAMPLE:
_To_Prn()
Result: Output is directed to the printer, and the user dialogue box
is invoked of the printer is not on-line.
_To_Prn('HPITALIC.TXT')
Result: Output is directed to the printer and the printer setup codes
in HPITALIC.TXT are sent to the printer one line at a time.
The user dialogue box is invoked of the printer is not on-line.
_To_Prn('HPITALIC.TXT',.F.)
Result: Same as above, but if the printer is not on line, the settings
of PRINT, DEVICE, and CONSOLE are left unchanged and the function
returns false.
******************************************************************************/